package springboot.demo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import springboot.demo.constant.UserConstant;

import javax.validation.constraints.NotBlank;

/**
 * 用户登录请求DTO
 * 用于接收前端传来的登录参数
 */
@Data
@Schema(description = "用户登录请求")
public class LoginRequest {
    
    /**
     * 用户登录名
     * 用于系统识别用户身份的唯一标识
     */
    @Schema(description = "登录名", example = "testuser", required = true)
    @NotBlank(message = UserConstant.ErrorMessage.LOGINNAME_EMPTY)
    private String loginname;
    
    /**
     * 用户密码
     * 登录验证的凭证，前端传输时建议进行加密处理
     */
    @Schema(description = "密码", example = "123456", required = true)
    @NotBlank(message = UserConstant.ErrorMessage.PASSWORD_EMPTY)
    private String password;
} 